<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="../jquery.min.js"></script>
<script type="text/javascript">
    //post请求
    var hostName="";
    function post(urlApi, data, success) {
        $.ajax({
            url: hostName + urlApi,
            type: 'POST',
            async: false,
            datatype: 'json',
            data: data,
            success: success,
            error: function (err) {
                console.log(err)
            }
        })
    }
    function tap(){
        var data={
            id:1,
            flag:"updateById",
            content:'普通课程'
        }
        post("Update",data,function(res){
            console.log(res);
        });
    }
    function tap2(){
        var data={
            param1:{
                id:1,
                flag:"findById",
                name:'wulida'
            },
            param2:{
                id:1,
                flag:"findAll",
                name:'wulida',
                pageSize:10,
                pageNum:6
            }
        }
        post("multiRetrieve",data,function(res){
            console.log(res);
        });
    }
    function tap3(){
        var data={
            flag:'findAll',
            pageSize:10,
            pageNum:6
        }
        post("pagingRetrieve",data,function(res){
            console.log(res);
        });
    }
    function tap4(){
        var data={
            flag:'deleteById',
            id:1
        }
        post("Delete",data,function(res){
            console.log(res);
        });
    }
</script>
<body>
    <div>
        hello world!
    </div>
    <div>
        <button onclick="tap()">点击</button>
        <button onclick="tap2()">点击</button>
        <button onclick="tap3()">点击</button>
        <button onclick="tap4()">删除</button>
    </div>
</body>
</html>